Data Flow Analysis of Programs in CPSMany

نویسندگان

  • Amr Sabry
  • Matthias Felleisen
چکیده

The widespread use of the continuation-passing style (CPS) transformation in compilers, opti-mizers, abstract interpreters, and partial evaluators reeects a common belief that the transformation has a positive eeect on the analysis of programs. Investigations by Nielson 14] and Burn/Filho 5, 6] support, to some degree, this belief with theoretical results. However, these investigations do not pinpoint the source of increased abstract information and do not explain the observation of many people that continuation-passing confuses some conventional data ow analyses. To understand the exact impact of the CPS transformation on program analysis, we derive three canonical data ow analyzers for the core of an applicative higher-order programming language. The rst analyzer is based on the direct semantics of the language, the second on a continuation-semantics of the language, and the last on the semantics of CPS terms. All analyzers compute the control ow graph of the source program and hence our results apply to a large class of data ow analyses. A comparison of the information gathered by the analyzers establishes two points: 1. The results of a direct analysis of a source program are incomparable to the results of an analysis of the equivalent CPS program. In other words, the translation of the source program to a CPS version may increase or decrease static information. The gain of information occurs only in non-distributive analyses and is solely due to the duplication of the analysis of the continuation. The loss of information is due to the confusion of distinct returns (calls to the continuation). 2. The analyzer based on the continuation semantics gets more accurate results than the direct analyzer, but again only in non-distributive analyses and by duplicating continuations along every execution path. However, when the idea continuation-passing is applied to looping constructs, the results of the semantic-CPS analysis are no longer computable. In view of these results, we argue that, in practice, a direct data ow analysis that relies on some amount of duplication, e.g., cloning, would be as satisfactory as a CPS analysis. 1 Data Flow Analysis of Programs in CPS Many compilers for higher-order applicative languages (Scheme, ML, Common Lisp) map source programs to programs in continuation-passing style (CPS) 1, 11, 12, 17]. Compiler writers believe that the intermediate representation based on CPS eases the production of code and facilitates optimizations. Numerous people also argue that the CPS transformation increases the precision of the data ow analysis …

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Information and data flow analysis for forestry sector in Iran as a basic requirement for designing a forest information system (FIS)

ABSTRACT The aim of this study was to evaluate the status of information on forest and data transfer and to identify the gaps in information and data flow in forestry sector in Iran. The study evaluated the data and information flow in three levels (control offices level, provincial offices level and organizational offices level) using the document analysis and questioning (interviews and ques...

متن کامل

Regional Analysis Low Flows in the Karkheh and Karoon Catchments

Analysis of low flow is one of the important considerations in any water resource project. Meanwhile, as a general idea it seems that flow control is more important than drought mitigation but it is necessary to pay more attention to drought problem in future projects. In this paper, available data for 28 selected watersheds were analyzed and then Flow Duration Curve was drew, and discharge of ...

متن کامل

Integrated Analysis of Choke Performance and Flow Behaviour in High-Rate, Deviated Gas-Condensate Wells

 Understanding the flow behaviour in a gas well is crucial for future production strategies, obtaining bottomhole conditions from wellhead production data, analyzing production data and estimating reservoir properties. In this work, the pressure profile and flow regime are studied on four wells of a multi-well, multi-layer gas-condensate reservoir, producing at high rate. The wells are deviate...

متن کامل

Estimation of Flow Zone Indicator Distribution by Using Seismic Data: A Case Study from a Central Iranian Oilfield

Flow unit characterization plays an important role in heterogeneity analysis and reservoir simulation studies. Usually, a correct description of the lateral variations of reservoir is associated with uncertainties. From this point of view, the well data alone does not cover reservoir properties. Because of large well distances, it is difficult to build the model of a heterogenic reservoir, but ...

متن کامل

Implementation Techniques for Efficient Data-Flow Analysis of Large Programs

Many software engineering tools such as program slicers must perform data-flow analysis in order to extract necessary information from the program source. These tools typically borrow much of their implementation from optimizing compilers. However, since these tools are expected to analyze programs in their entirety, rather than functions in isolation, the time and space performance of the data...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1994